package com.richy.toweather.contract;

import com.richy.toweather.entity.WeatherEntity;

import java.util.List;

/**
 * @FileName MainContract
 * @Description MainContract
 * @Author x925914554@gmail.com
 * @Company
 * @CreateDate 18-11-13
 * @LastModifyDate 18-11-13
 * @Since
 * @Version
 */
public interface MainContract {
    interface Model {
        void getData(String city);
        void getDatas(String[] cities);
    }

    interface View {

        void showLoading(boolean loading);
        /**
         * presenter获取数据后调用此方法将数据展示到界面上
         *
         * @param weatherEntities 获取到的天气数据
         */
        void setData(List<WeatherEntity> weatherEntities);

        /**
         * presenter获取数据失败调用此方法将错误信息展示到界面上
         *
         * @param e
         */
        void dataError(Throwable e);
    }

    interface Presenter {
        /**
         * 从服务器获取天气数据
         */
        void getDatas(String[] cities);
    }
}
